#ifndef HASHFCN_H
#define HASHFCN_H

#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <time.h>

typedef struct _HASHFCN {

 unsigned seed;
 unsigned scale;
 unsigned hardener;
 unsigned (*hash_fcn)(struct _HASHFCN * p,
                      unsigned char *d,
                      int n );
 int      (*keycmp_fcn)( const void *s1,
                         const void *s2,
                         size_t n);
}HASHFCN;

HASHFCN * hashfcn_new( int nrows );
void hashfcn_free( HASHFCN * p );
void hashfcn_static( HASHFCN * p );

unsigned hashfcn_hash( HASHFCN * p, unsigned char *d, int n );

int hashfcn_set_keyops( HASHFCN * p,
                          unsigned (*hash_fcn)( HASHFCN * p,
                                                unsigned char *d,
                                                int n),
                          int (*keycmp_fcn)( const void *s1,
                                             const void *s2,
                                             size_t n));



unsigned int BKDRHash(char *str);


#endif
